/**************************************************
beginning of licensing agreement
Microsoft Public License (Ms-PL)

This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.

1. Definitions

The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.

A "contribution" is the original software, or any additions or changes to the software.

A "contributor" is any person that distributes its contribution under this license.

"Licensed patents" are a contributor's patent claims that read directly on its contribution.

2. Grant of Rights

(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.

(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.

3. Conditions and Limitations

(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.

(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.

(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.

(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. 
end of licensing agreement
**************************************************/
//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version: 1.1.4322.573
//
//     Changes to this file may cause incorrect behavior and will be lost if 
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by xsd, Version=1.1.4322.573.
// 
namespace PssdiagParametersSchema.Namespace {
    using System;
    using System.Data;
    using System.Xml;
    using System.Runtime.Serialization;
    
    
    [Serializable()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Diagnostics.DebuggerStepThrough()]
    [System.ComponentModel.ToolboxItem(true)]
    public class Parameters : DataSet {
        
        private ParameterDataTable tableParameter;
        
        public Parameters() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected Parameters(SerializationInfo info, StreamingContext context) {
            string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
            if ((strSchema != null)) {
                DataSet ds = new DataSet();
                ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema)));
                if ((ds.Tables["Parameter"] != null)) {
                    this.Tables.Add(new ParameterDataTable(ds.Tables["Parameter"]));
                }
                this.DataSetName = ds.DataSetName;
                this.Prefix = ds.Prefix;
                this.Namespace = ds.Namespace;
                this.Locale = ds.Locale;
                this.CaseSensitive = ds.CaseSensitive;
                this.EnforceConstraints = ds.EnforceConstraints;
                this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
                this.InitVars();
            }
            else {
                this.InitClass();
            }
            this.GetSerializationData(info, context);
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
        public ParameterDataTable Parameter {
            get {
                return this.tableParameter;
            }
        }
        
        public override DataSet Clone() {
            Parameters cln = ((Parameters)(base.Clone()));
            cln.InitVars();
            return cln;
        }
        
        protected override bool ShouldSerializeTables() {
            return false;
        }
        
        protected override bool ShouldSerializeRelations() {
            return false;
        }
        
        protected override void ReadXmlSerializable(XmlReader reader) {
            this.Reset();
            DataSet ds = new DataSet();
            ds.ReadXml(reader);
            if ((ds.Tables["Parameter"] != null)) {
                this.Tables.Add(new ParameterDataTable(ds.Tables["Parameter"]));
            }
            this.DataSetName = ds.DataSetName;
            this.Prefix = ds.Prefix;
            this.Namespace = ds.Namespace;
            this.Locale = ds.Locale;
            this.CaseSensitive = ds.CaseSensitive;
            this.EnforceConstraints = ds.EnforceConstraints;
            this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
            this.InitVars();
        }
        
        protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
            System.IO.MemoryStream stream = new System.IO.MemoryStream();
            this.WriteXmlSchema(new XmlTextWriter(stream, null));
            stream.Position = 0;
            return System.Xml.Schema.XmlSchema.Read(new XmlTextReader(stream), null);
        }
        
        internal void InitVars() {
            this.tableParameter = ((ParameterDataTable)(this.Tables["Parameter"]));
            if ((this.tableParameter != null)) {
                this.tableParameter.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "Parameters";
            this.Prefix = "";
            this.Namespace = "http://tempuri.org/Parameters.xsd";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = false;
            this.tableParameter = new ParameterDataTable();
            this.Tables.Add(this.tableParameter);
        }
        
        private bool ShouldSerializeParameter() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void ParameterRowChangeEventHandler(object sender, ParameterRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ParameterDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnname;
            
            private DataColumn columnvalue;
            
            internal ParameterDataTable() : 
                    base("Parameter") {
                this.InitClass();
            }
            
            internal ParameterDataTable(DataTable table) : 
                    base(table.TableName) {
                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                    this.CaseSensitive = table.CaseSensitive;
                }
                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                    this.Locale = table.Locale;
                }
                if ((table.Namespace != table.DataSet.Namespace)) {
                    this.Namespace = table.Namespace;
                }
                this.Prefix = table.Prefix;
                this.MinimumCapacity = table.MinimumCapacity;
                this.DisplayExpression = table.DisplayExpression;
            }
            
            [System.ComponentModel.Browsable(false)]
            public int Count {
                get {
                    return this.Rows.Count;
                }
            }
            
            internal DataColumn nameColumn {
                get {
                    return this.columnname;
                }
            }
            
            internal DataColumn valueColumn {
                get {
                    return this.columnvalue;
                }
            }
            
            public ParameterRow this[int index] {
                get {
                    return ((ParameterRow)(this.Rows[index]));
                }
            }
            
            public event ParameterRowChangeEventHandler ParameterRowChanged;
            
            public event ParameterRowChangeEventHandler ParameterRowChanging;
            
            public event ParameterRowChangeEventHandler ParameterRowDeleted;
            
            public event ParameterRowChangeEventHandler ParameterRowDeleting;
            
            public void AddParameterRow(ParameterRow row) {
                this.Rows.Add(row);
            }
            
            public ParameterRow AddParameterRow(string name, string value) {
                ParameterRow rowParameterRow = ((ParameterRow)(this.NewRow()));
                rowParameterRow.ItemArray = new object[] {
                        name,
                        value};
                this.Rows.Add(rowParameterRow);
                return rowParameterRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ParameterDataTable cln = ((ParameterDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ParameterDataTable();
            }
            
            internal void InitVars() {
                this.columnname = this.Columns["name"];
                this.columnvalue = this.Columns["value"];
            }
            
            private void InitClass() {
                this.columnname = new DataColumn("name", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnname);
                this.columnvalue = new DataColumn("value", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnvalue);
                this.columnname.Namespace = "";
                this.columnvalue.Namespace = "";
            }
            
            public ParameterRow NewParameterRow() {
                return ((ParameterRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ParameterRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ParameterRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ParameterRowChanged != null)) {
                    this.ParameterRowChanged(this, new ParameterRowChangeEvent(((ParameterRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ParameterRowChanging != null)) {
                    this.ParameterRowChanging(this, new ParameterRowChangeEvent(((ParameterRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ParameterRowDeleted != null)) {
                    this.ParameterRowDeleted(this, new ParameterRowChangeEvent(((ParameterRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ParameterRowDeleting != null)) {
                    this.ParameterRowDeleting(this, new ParameterRowChangeEvent(((ParameterRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveParameterRow(ParameterRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ParameterRow : DataRow {
            
            private ParameterDataTable tableParameter;
            
            internal ParameterRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableParameter = ((ParameterDataTable)(this.Table));
            }
            
            public string name {
                get {
                    try {
                        return ((string)(this[this.tableParameter.nameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableParameter.nameColumn] = value;
                }
            }
            
            public string value {
                get {
                    try {
                        return ((string)(this[this.tableParameter.valueColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableParameter.valueColumn] = value;
                }
            }
            
            public bool IsnameNull() {
                return this.IsNull(this.tableParameter.nameColumn);
            }
            
            public void SetnameNull() {
                this[this.tableParameter.nameColumn] = System.Convert.DBNull;
            }
            
            public bool IsvalueNull() {
                return this.IsNull(this.tableParameter.valueColumn);
            }
            
            public void SetvalueNull() {
                this[this.tableParameter.valueColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ParameterRowChangeEvent : EventArgs {
            
            private ParameterRow eventRow;
            
            private DataRowAction eventAction;
            
            public ParameterRowChangeEvent(ParameterRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ParameterRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
